load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")

package(default_visibility = ["//rs/sns/governance:__pkg__"])

DEPENDENCIES = [
    # Keep sorted.
    "//rs/sns/governance/token_valuation",
    "@crate_index//:num-traits",
    "@crate_index//:rust_decimal",
]

MACRO_DEPENDENCIES = [
    # Keep sorted.
    "@crate_index//:rust_decimal_macros",
]

DEV_DEPENDENCIES = [
    # Keep sorted.
    "//packages/icrc-ledger-types",
    "//rs/nervous_system/common",
    "//rs/types/base_types",
    "@crate_index//:candid",
    "@crate_index//:lazy_static",
]

MACRO_DEV_DEPENDENCIES = [
]

LIB_SRCS = glob(
    ["src/**"],
    # Ensures that we do not need to rebuild just because a _test.rs file
    # changed.
    exclude = ["**/*tests.rs"],
)

rust_library(
    name = "proposals_amount_total_limit",
    srcs = LIB_SRCS,
    crate_name = "ic_sns_governance_proposals_amount_total_limit",
    proc_macro_deps = MACRO_DEPENDENCIES,
    version = "0.0.1",
    deps = DEPENDENCIES,
)

rust_test(
    name = "proposals_amount_total_limit_test",
    srcs = glob(["src/**/*.rs"]),
    proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES,
    deps = DEPENDENCIES + DEV_DEPENDENCIES,
)
